from django_filters.rest_framework import DjangoFilterBackend
from drf_spectacular.utils import extend_schema
from rest_framework.request import Request
from rest_framework.viewsets import ModelViewSet
from rest_framework.filters import SearchFilter


### searilizer
from rest_framework.serializers import ModelSerializer

from demoappv1.models import DemoTable

class DemoSerializer(ModelSerializer):
    class Meta:
        model = DemoTable
        fields = '__all__'

@extend_schema(tags=['users'])
class DemoViewSet(ModelViewSet):
    queryset = DemoTable.objects.all()
    serializer_class = DemoSerializer
    @extend_schema('create', request=DemoSerializer)
    def create(self, request:Request, *args, **kwargs):
        return super().create(request, *args, **kwargs)